package com.tianqu.tms.www.transfer.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.tianqu.tms.core.base.TmsAction;
import com.tianqu.tms.core.base.UserContext;
import com.tianqu.tms.core.util.TmsConstants;
import com.tianqu.tms.www.transfer.actionform.TransferRgActionForm;
import com.tianqu.tms.www.transfer.viewhelper.TransferRgInputViewHelper;

public class TransferSeniorChangeJYPConfirmAction extends TmsAction {

	@Override
	protected ActionForward doAction(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response,
			UserContext uc) throws Exception {
		TransferRgInputViewHelper view = (TransferRgInputViewHelper)uc.getAttribute(TmsConstants.VIEWHELP);
		if(view == null) view = new TransferRgInputViewHelper();
		TransferRgActionForm inForm = (TransferRgActionForm)form;
		view.setVendorCodeOld(inForm.getVendorCodeOld());
		view.setModelCodeOld(inForm.getModelCodeOld());
		view.setCarTypeOld(inForm.getCarTypeOld());
		view.setRegisterCardNoOld(inForm.getRegisterCardNoOld());
		view.setCarMarketInOld(inForm.getCarMarketInOld());
		view.setCarOwnerOld(inForm.getCarOwnerOld());
		view.setCarOwnerIdCardNoOld(inForm.getCarOwnerIdCardNoOld());
		view.setOwnerOrgNoOld(inForm.getOwnerOrgNoOld());
		view.setOwnerAddressOld(inForm.getOwnerAddressOld());
		view.setOwnerPhoneOld(inForm.getOwnerPhoneOld());
		view.setNewCarOwnerOld(inForm.getNewCarOwnerOld());
		view.setNewcarOwnerIdCardNoOld(inForm.getNewcarOwnerIdCardNoOld());
		view.setNewOwnerOrgNoOld(inForm.getNewOwnerOrgNoOld());
		view.setNewOwnerAddressOld(inForm.getNewOwnerAddressOld());
		view.setNewOwnerPhoneOld(inForm.getNewOwnerPhoneOld());
		view.setTransferPriceOld(inForm.getTransferPriceOld());
		view.setTaxNoOld(inForm.getTaxNoOld());
		view.setTransNoOld(inForm.getTransNoOld());
		view.setTransMarketOld(inForm.getTransMarketOld());
		view.setReason(inForm.getReason());
		//追加
		view.setNewAgentNameOld(inForm.getNewAgentNameOld());
		view.setNewAgentOwnerIdCardNoOld(inForm.getNewAgentOwnerIdCardNoOld());
		view.setNewAgentAddressOld(inForm.getNewAgentAddressOld());
		view.setNewAgentPhoneOld(inForm.getNewAgentPhoneOld());
		//
		view.setOwnerTypeOld(inForm.getOwnerTypeOld());
		view.setTransferTypeOld(inForm.getTransferTypeOld());
		view.setMoveOutProvinceOld(inForm.getMoveOutProvinceOld());
		view.setMoveOutCityOld(inForm.getMoveOutCityOld());
		view.setNewOwnerTypeOld(inForm.getNewOwnerTypeOld());
		uc.setAttribute(TmsConstants.VIEWHELP, view);
		return mapping.findForward(TmsConstants.SUCCESS);
	}

}
